﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "PaperPlayerController.generated.h"
class UInputMappingContext;
class UInputAction;
class APaperZDCharacter;
struct FInputActionValue;
/**
 * 
 */
UCLASS()
class MYTILEMAPGAME_API APaperPlayerController : public APlayerController
{
	GENERATED_BODY()
public:
	virtual void BeginPlay() override;
	virtual void SetupInputComponent() override;

protected:
	//定义输入映射
	UPROPERTY(EditAnywhere,Category="Input")
	TObjectPtr<UInputMappingContext> AuraContext;
	UPROPERTY(EditAnywhere,Category="Input")
	TObjectPtr<UInputAction> MoveAction;
	UPROPERTY(EditAnywhere,Category="Input")
	TObjectPtr<UInputAction> JumpAction;
	//角色信息
	APaperZDCharacter* PaperZDCharacter;
	//移动数值
	float MoveInputValue;
	void Move(const FInputActionValue& InputActionValue);
	void Jump();
	void StopJump();
	//是否处于地面
	UFUNCTION(BlueprintCallable)
	bool IsGround() const;
	//是都在地面待机
	UFUNCTION(BlueprintCallable)
	bool IsLanding() const;
	//设置移动数值
	void SetMoveInputValue(const float InuptValue);
};
